import { createRouter, createWebHashHistory } from "vue-router";

// import { userStore } from "@/store/modules/user"
// // 获取项目pina对象
// const user = userStore()
const routes = [
  {
    path: "/login",
    name: "login",
    component: () => import("@/view/Login/Login.vue"),
  },
  {
    path: "/register",
    name: "register",
    component: () => import("@/view/Register/Register.vue"),
  },

  // {
  //     path: '/error',
  //     name: 'error',
  //     component: () => import('@/view/Error/Error.vue'),
  // },
  {
    path: "/home",
    name: "home",
    component: () => import("@/Layout/Layout.vue"),
    // redirect: "/Workcenter/Organizationactivity",
    children: [
      {
        path: "/userinfo",
        name: "userinfo",
        component: () => import("@/view/Page/Userinfo/Userinfo.vue"),
        meta: {
          title: "信息修改",
          indication: 0,
          isShow: true,
        },
      },
      {
        path: "/partyeducation",
        name: "partyeducation",
        component: () =>
          import("@/view/Page/partyeducation/partyeducation.vue"),
        meta: {
          title: "党员教育",
          indication: 0,
          isShow: true,
        },
      },
      {
        path: "/homeview",
        name: "homeview",
        component: () => import("@/view/Page/home/index.vue"),
        meta: {
          title: "首页",
          indication: 0,
          isShow: false,
          icon: "HomeFilled",
        },
      },
      {
        path: "/updatepass",
        name: "updatepass",
        component: () => import("@/view/Page/updatepass/updatepass.vue"),
        meta: {
          title: "密码修改",
          indication: 0,
          isShow: true,
        },
      },

      // {
      //   path: "/usermannge",
      //   name: "usermannge",
      //   component: () => import("@/view/Page/usermannge/usermannge.vue"),
      //   meta: {
      //     title: "用户管理",
      //     icon: "User",
      //     indication: 0,
      //     isShow: false,
      //   },
      // },
      // {
      //     path: '/Workcenter',
      //     name: 'Workcenter',
      //     redirect: "/Workcenter/Organizationactivity",
      //     meta: {
      //             title: '党务工作中心',
      //         icon:'OfficeBuilding',
      //         indication: 1
      //     },
      //     children: [
      //         {
      //             path: '/Workcenter/Organizationactivity',
      //             name: 'Organizationactivity',
      //             component: () => import('@/view/Page/Workcenter/Organizationactivity/Organizationactivity.vue'),
      //             meta: {
      //                 title: '组织生活',
      //                 indication: 1
      //             }
      //         },
      //         {
      //             path: '/Workcenter/Developmentparty',
      //             name: 'Developmentparty',
      //             component: () => import('@/view/Page/Workcenter/Developmentparty/Developmentparty.vue'),
      //             meta: {
      //                 title: '发展党员',
      //                 indication: 1
      //             }
      //         },
      //         {
      //             path: '/Workcenter/Duesmanagement',
      //             name: 'Duesmanagement',
      //             component: () => import('@/view/Page/Workcenter/Duesmanagement/Duesmanagement.vue'),
      //             meta: {
      //                 title: '党费管理',
      //                 indication: 1
      //             }
      //         },
      //         {
      //             path: '/Workcenter/Transferorganizational',
      //             name: 'Transferorganizational',
      //             component: () => import('@/view/Page/Workcenter/Transferorganizational/Transferorganizational.vue'),
      //             meta: {
      //                 title: '组织关系转接',
      //                 indication: 1
      //             }
      //         },
      //         {
      //             path: '/Workcenter/Fornotification',
      //             name: 'Fornotification',
      //             component: () => import('@/view/Page/Workcenter/Fornotification/Fornotification.vue'),
      //             meta: {
      //                 title: '表彰通报',
      //                 indication: 1
      //             }
      //         },
      //     ]
      // },
      // {
      //     path: '/Servicecenter',
      //     name: 'Servicecenter',
      //     // component: () => import('@/view/Page/Servicecenter/Servicecenter.vue'),
      //     meta: {
      //             title: '党群服务中心',
      //         icon:'Service',
      //         indication: 1
      //     },
      //     redirect: "/Servicecenter/Visitcontact",
      //     children: [
      //         {
      //             path: '/Servicecenter/Visitcontact',
      //             name: 'Visitcontact',
      //             component: () => import('@/view/Page/Servicecenter/Visitcontact/Visitcontact.vue'),
      //             meta: {
      //                 title: '走访联系',
      //                 indication: 1
      //             }
      //         },
      //         // {
      //         //     path: '/Servicecenter/Partnerassistance',
      //         //     name: 'Partnerassistance',
      //         //     component: () => import('@/view/Page/Servicecenter/Partnerassistance/Partnerassistance.vue'),
      //         //     meta: {
      //         //         title: '结对帮扶',
      //         //         indication: 1
      //         //     }
      //         // },
      //         {
      //             path: '/Servicecenter/Volunteerservice',
      //             name: 'Volunteerservice',
      //             component: () => import('@/view/Page/Servicecenter/Volunteerservice/Volunteerservice.vue'),
      //             meta: {
      //                 title: '志愿服务',
      //                 indication: 1
      //             }
      //         },
      //         {
      //             path: '/Servicecenter/Activitiesbetween',
      //             name: 'Activitiesbetween',
      //             component: () => import('@/view/Page/Servicecenter/Activitiesbetween/Activitiesbetween.vue'),
      //             meta: {
      //                 title: '党群活动',
      //                 indication: 1
      //             }
      //         },
      //     ]
      // },
      // {
      //     path: 'Trainingcenter',
      //     name: 'Trainingcenter',
      //     // component: () => import('@/view/Page/Trainingcenter/Trainingcenter.vue'),
      //     meta: {
      //         icon:'School',
      //         title: '教育培训中心',
      //         indication: 1
      //     },
      //     redirect: "/Trainingcenter/Partyeducation",
      //     children:[
      //         {
      //             path: '/Trainingcenter/Partyeducation',
      //             name: 'Partyeducation',
      //             component: () => import('@/view/Page/Trainingcenter/Partyeducation/Partyeducation.vue'),
      //             meta: {
      //                 title: '党员教育',
      //                 indication: 1
      //             },
      //         },
      //         // {
      //         //     path: '/Trainingcenter/Onlinestudy',
      //         //     name: 'Onlinestudy',
      //         //     component: () => import('@/view/Page/Trainingcenter/Onlinestudy/Onlinestudy.vue'),
      //         //     meta: {
      //         //         title: '在线学习',
      //         //         indication: 1
      //         //     },
      //         // },
      //         // {
      //         //     path: '/Trainingcenter/TestManage',
      //         //     name: 'TestManage',
      //         //     component: () => import('@/view/Page/Trainingcenter/TestManage/TestManage.vue'),
      //         //     meta: {
      //         //         title: '考试管理',
      //         //         indication: 1
      //         //     },
      //         // },
      //     ]
      // },
      // {
      //     path:'supervisionandstatistics',
      //     name:'supervisionandstatistics',
      //     // component: () => import('@/view/Page/supervisionandstatistics/supervisionandstatistics.vue'),
      //     meta: {
      //         title: '监督与统计中心',
      //         icon:'Histogram',
      //         indication: 1
      //     },
      //     redirect: "/supervisionandstatistics/Statisticalform",
      //     children:[
      //         {
      //             path:'/supervisionandstatistics/Statisticalform',
      //             name:'Statisticalform',
      //             component: () => import('@/view/Page/supervisionandstatistics/Statisticalform/Statisticalform.vue'),
      //             meta: {
      //                 title: '统计报表',
      //                 indication: 1
      //             },
      //         }
      //     ]
      // },
      // {
      //     path: '/userinfo',
      //     name: 'userinfo',
      //     component: () => import('@/view/Page/Userinfo/Userinfo.vue'),
      //     icon:'Histogram',
      //     meta: {
      //         title: '用户信息',
      //         indication: 0
      //     },
      // },
    ],
  },
  {
    path: "/",
    redirect: "/login",
  },
  // {
  //     path: '/:pathMatch(.*)',
  //     redirect: '/error'
  // },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
